<template>
  <div class="gallary" @click="closeGallary">
    <div class="wrapper">
      <swiper :options="swiperOption">
        <div class="swiper-pagination" slot="pagination"></div>
        <!-- slides -->
        <swiper-slide v-for="(img, index) in imgs" :key="index"><img :src="img" alt="" class="swiper-img"></swiper-slide>
      </swiper>
    </div>
  </div>
</template>
<script>
export default {
  name: "commonGallary",
  data () {
    return {
      swiperOption:{
        pagination: '.swiper-pagination',
        paginationType: 'fraction',
        observer: true,
        observeParents:true
      }
    }
  },
  props: {
    imgs:Array
  },
  methods: {
    closeGallary () {
      this.$emit('close')
    }
  }
};
</script>
<style lang="scss" scoped>
.gallary {
  position: fixed;
  z-index: 99;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  .wrapper{
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    img{
      width: 100%;
    }
    .swiper-pagination{
      color: #fff;
      bottom: -1rem;
    }
  }
}
</style>
<style lang="scss">
.gallary .swiper-container{
  overflow: visible !important;
}
</style>



